scrolledwindow: Trigger builtin kinetic deceleration on libinput devices
authorCarlos Garnacho <carlosg@gnome.org>
Sat, 23 May 2015 13:57:41 +0000 (15:57 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sun, 24 May 2015 14:58:35 +0000 (16:58 +0200)
commit48bfabe59eb4e50a3546a633fd22a02cd08bea99
tree02c60dc5b944c5c1e7292d815be8307e1fd16285
parentfc2830394895f236352bea2024dda0e962dd2c53
scrolledwindow: Trigger builtin kinetic deceleration on libinput devices

The libinput driver will send a 0/0 scroll event on touchpads and other
devices where it knows scrolling stopped for sure. Use these events to
trigger kinetic scrolling from there.

The mechanism is similar to GtkGestureSwipe, we keep a backlog of the
latest dx/dy till a previous point in time, and calculate the final
velocities from there, with the difference we're dealing with scroll
units, and not pixel distances.

https://bugzilla.gnome.org/show_bug.cgi?id=749770
gtk/gtkscrolledwindow.c